/**
 * Copyright 2009-2010 - YangJiandong(chunquedong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 你可以自由复制、传播本项目的下载包文件，但必须保持其完整性。
 * 我们不用对使用中的风险及由此造成的损失承担任何责任。
 * 详细情况请见《ChunMap许可协议》。

 * 想了解更多有关ChunMap的信息，请访问http://code.google.com/p/chunmap/
 */
package chunmap.example.buffer;

import java.util.List;

import chunmap.example.BaseGeometryMap;
import chunmap.model.coord.Coordinate2D;
import chunmap.model.coord.Position;
import chunmap.model.elem.LineSegment;
import chunmap.model.geom.GeoPoint;
import chunmap.model.geom.Geometry;
import chunmap.model.operate.buffer.LineBuffer;
import chunmap.model.operate.buffer.PointBuffer;

/**
 * @author chunquedong
 * 
 */
public class SimpleBufferTest extends BaseGeometryMap {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SimpleBufferTest me = new SimpleBufferTest();
		me.init();
	}

	@Override
	protected void addGeometry(List<Geometry> geoms) {
		GeoPoint p = new GeoPoint(1, 1);
		PointBuffer pb = new PointBuffer();
		geoms.add(pb.createBuffer(p.getCoordinate(), 5));
		geoms.add(p);

		Position p1 = new Coordinate2D(-5, -5);
		Position p2 = new Coordinate2D(-10, -10);
		LineSegment lseg = new LineSegment(p1, p2);
		LineBuffer lb = new LineBuffer();
		geoms.add(lb.singleLineNoCapBuffer(lseg, 5));
		geoms.add(lseg.toLineString());
	}
}
